package leetcode.code2347;

public class Solution {
	public String bestHand(int[] ranks, char[] suits) {
		int max = 0;
		int[] h = new int[4];
		for (char c : suits) {
			max = Math.max(max, ++h[c - 'a']);
		}
		if (max == 5) {
			return "Flush";
		}
		max = 0;
		h = new int[14];
		for (int n : ranks) {
			max = Math.max(max, ++h[n]);
		}
		if (max > 2) {
			return "Three of a Kind";
		}
		if (max == 2) {
			return "Pair";
		}
		return "High Card";
	}
}
